package com.yeung.exam;

import java.util.Scanner;

public class 漂流活动 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] weights = line.split(" ");
        int[] wes = new int[weights.length];
        for (int i = 0; i < weights.length; i++) {
            wes[i] = Integer.parseInt(weights[i]);
        }
        int able = Integer.parseInt(scanner.nextLine());
        int needShips = 1;
        for (int i = 0; i < wes.length; i++) {
            int sum = 0;
            for (int k = 0; k <= i; k++) {
                sum += wes[k];
            }
            //大于一艘船的重量
            if (sum > able) {
                int tmpNeed = 1;
                if (sum % able == 0) tmpNeed = sum / able;
                else
                    needShips = sum / able + 1;
                //需要增加船只
                if (tmpNeed > needShips) needShips = tmpNeed;
            }

        }
        System.out.println(needShips);

    }

}
